<include file="__THEME__/header" />
<include file="__THEME__/editor" />
<script type="text/javascript" src="../Public/Js/common.js"></script>
<link  href="../Public/group.css" rel="stylesheet" type="text/css"/>
<script>
	function checkform(v_form){
		if(getLength(v_form.title.value) == 0) {
			v_form.title.focus();
			ui.error('标题不能为空');
			return false;
		}
		if(getLength(v_form.title.value) > 30) {
			v_form.title.focus();			
			ui.error('标题内容不能超过30个字');
			return false;
		}
		
		if(checkPostContent(v_form.content.value) == 0) {
			v_form.content.focus();
			//ui.error('内容不能为空');
			//return false;
		}
		return true;
	}
</script>
<div class="content_holder">
<div class="content no_bg">
  <!-- 内容 begin  -->
<include file="../Public/_mainNav" />
  <div class="main no_l">
    <!-- 右侧内容 begin  -->
    <div class="mainbox"> <include file="../Public/_groupInfo" />
      <div class="mainbox_appC">
      <include file="../Public/top" />
        <div class="groupBox">
            <div class="box1">
            <h2 class="tit_h2">发表新话题</h2>
              <form method="post" action="{:U('group/Topic/doAdd',array('gid'=>$gid))}" onsubmit="return checkform(this);">
                <ul class="fW100_ul">
                  <li class="mb10" >
                    <div class="left alR" style="width:110px;"><strong style="line-height:26px">标题：</strong></div>
                    <div style="margin-left:120px;">
	                    <select name="cid" class="text mr5" style="vertical-align:middle">
	                      <option value="0">未分类</option>
	                      <php>foreach( $category_list as $value ){</php>
	                      <option value="{$value['id']}">{$value['title']}</option>
	                      <php>}</php>
	                    </select>
                      <input name="title" class="text" style="width:70%;" onBlur="this.className='text'" onFocus="this.className='text2'" type="text">
                    </div>
                  </li>
                  <li class="mb10" style="overflow:hidden;*zoom:1">
                    <div class="left alR" style="width:110px;padding-top:0"><strong style="line-height:26px">内容：</strong></div>
                    <div style="margin:0 20px 0 120px;_margin:0 20px 0 123px">
                      <textarea id="content" name="content" style="height:350px;"></textarea>
                    </div>
                  </li>
                  <if condition="$groupinfo['openUploadFile'] && ($groupinfo['whoUploadFile'] == 3 || ($groupinfo['whoUploadFile'] == 2 && $isadmin))">
                  <li class="mb10">
                    <div class="left alR" style="width:110px;"><strong>附件：</strong></div>
                  	<div style="margin-left:120px;">
                      {:W('UploadAttach', array('uid'=>$mid,'gid'=>$gid))}
                    </div>
                  </li>
                  </if>
                  <li class="mb10">
                    <div class="left alR" style="width:110px;">&nbsp;</div>
                    <div style="margin-left:120px;">
                      <input type="hidden" name="addsubmit" value="do" >
                      <input name="button" type="submit" class="btn_b mt5" id="button" value="发表话题" />
                    </div>
                  </li>
                </ul>
              </form>
            </div>
        </div>
      </div>
      <div class="c"></div>
    </div>
  </div>
  <!-- 右侧内容 end  -->
</div>
</div>
<!-- 内容 end -->
<script>
$(document).ready(function(){
	loadEditor("content",false);
});
</script> 
<include file="__THEME__/footer" />